package com.asset.dispoal.dicData.service;

import com.asset.dispoal.dicData.api.GbDictDataService;
import com.asset.dispoal.dicData.dto.GbDictDataRequest;
import com.asset.dispoal.dicData.service.commom.DeleteDictDataCommand;
import com.asset.dispoal.dicData.service.commom.InsertDictDataCommand;
import com.asset.dispoal.dicData.service.commom.QueryPageCommand;
import com.asset.dispoal.dicData.service.commom.UpdateDicDataCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.mhuang.pacebox.springboot.protocol.Result;
import tech.mhuang.pacebox.springboot.protocol.data.PageVO;


/**
 * 字典数据表服务实现类
 *
 * @author: mhuang
 * @date: 2022-02-24 14:28:20
 */
@Service
public class GbDictDataServiceImpl implements GbDictDataService {


    @Autowired
    QueryPageCommand queryPageCommand;

    @Autowired
    InsertDictDataCommand insertDictDataCommand;

    @Autowired
    DeleteDictDataCommand deleteDictDataCommand;

    @Autowired
    UpdateDicDataCommand updateDicDataCommand;

    @Override
    public void insert(GbDictDataRequest request) {
        insertDictDataCommand.execute(request);
    }

    @Override
    public void delete(String id) {
        deleteDictDataCommand.execute(id);
    }

    @Override
    public void update(GbDictDataRequest request) {
        updateDicDataCommand.execute(request);
    }

    @Override
    public Result<PageVO> queryPage(GbDictDataRequest gbDictDataRequest) {
        return queryPageCommand.execute(gbDictDataRequest);
    }


}